//
//  HJHomeCell.m
//  Sneakers
//
//  Created by 胡光健 on 2017/9/20.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "HJHomeCell.h"
#import "HJHomeModel.h"
@implementation HJHomeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.titleLabel.font = HJFontSize(mScreenWidth/414*15);
    self.moneyLabel.font = HJFontSize(mScreenWidth/414*18);
    self.percentLabel.font = HJFontSize(mScreenWidth/414*15);
    self.artNoLabel.font = HJFontSize(mScreenWidth/414*13);
    self.statueLabel.font = HJFontSize(mScreenWidth/414*13);
}

-(void)setModel:(HJHomeModel *)model {
    self.titleLabel.text = model.shoes_name;
    self.moneyLabel.text = [NSString stringWithFormat:@"￥%@",model.sell_money];
    self.artNoLabel.text = [NSString stringWithFormat:@"货号 %@",model.shoes_article_number];
    self.statueLabel.text = [NSString stringWithFormat:@"出售 %@ | 求购 %@",model.sell_num,model.want_buy_num];
    [self.mainImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@",model.avatar_base_url,model.avatar_path]] placeholderImage:nil];
    if ([model.state2 isEqual:@0]) {
        self.percentLabel.textColor = HJColor(255, 72, 74);
        self.image.image = HJImage(@"Fill 7");
    }else {
        self.percentLabel.textColor = HJColor(71, 201, 157);
        self.image.image = HJImage(@"Fill 1 Copy 00");
    }
    if ([model.percent isEqualToString:@"0.00"]) {
        self.percentLabel.text = @"";
        self.image.hidden = YES;
    }else {
        self.percentLabel.text = [NSString stringWithFormat:@"%@%%",model.percent];
    }
    
}
@end
